import axios from 'axios';

let instance = new axios.create({
    // baseURL: 'http://116.198.162.65:8089/scs/api/app',
    baseURL: 'http://59.111.56.96:38084/sbm-srv',
    // timeout: 20000,
    showLoading: true //需要loading
});

/**
 * 响应拦截
 */
instance.interceptors.response.use(
    response => {

        if (response.data.code) {
            if (response.data.code === 401 || response.data.code === 10001 || response.data.code === 10021) {
                console.log('出错了！')
            }
            // return Promise.reject(response.data)
            return response
        }

        // return response.data
        return response
    },
    error => Promise.reject(error)
)
export default instance;
